//   Copyright 2011 Microsoft Corporation
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.

namespace System.Data.OData {
    using System;
    using System.Reflection;
    using System.Globalization;
    using System.Resources;
    using System.Text;
    using System.Threading;
    using System.Security.Permissions;

    
    using System.ComponentModel;

    [AttributeUsage(AttributeTargets.All)]
    internal sealed class TextResDescriptionAttribute : DescriptionAttribute {

        private bool replaced = false;

        /// <summary>
        ///     Constructs a new sys description.
        /// </summary>
        /// <param name='description'>
        ///     description text.
        /// </param>
        public TextResDescriptionAttribute(string description) : base(description) {
        }

        /// <summary>
        ///     Retrieves the description text.
        /// </summary>
        /// <returns>
        ///     description
        /// </returns>
        public override string Description {
            get {
                if (!replaced) {
                    replaced = true;
                    DescriptionValue = TextRes.GetString(base.Description);
                }
                return base.Description;
            }
        }
    }

    [AttributeUsage(AttributeTargets.All)]
    internal sealed class TextResCategoryAttribute : CategoryAttribute {

        public TextResCategoryAttribute(string category) : base(category) {
        }

        protected override string GetLocalizedString(string value) {
            return TextRes.GetString(value);
        }
    }


    /// <summary>
    ///    AutoGenerated resource class. Usage:
    ///
    ///        string s = TextRes.GetString(TextRes.MyIdenfitier);
    /// </summary>
    
    internal sealed class TextRes {
        internal const string General_InternalError = "General_InternalError";
        internal const string General_InvalidEnumValue = "General_InvalidEnumValue";
        internal const string ODataRequestMessage_AsyncNotAvailable = "ODataRequestMessage_AsyncNotAvailable";
        internal const string ODataRequestMessage_StreamTaskIsNull = "ODataRequestMessage_StreamTaskIsNull";
        internal const string ODataRequestMessage_MessageStreamIsNull = "ODataRequestMessage_MessageStreamIsNull";
        internal const string ODataResponseMessage_AsyncNotAvailable = "ODataResponseMessage_AsyncNotAvailable";
        internal const string ODataResponseMessage_StreamTaskIsNull = "ODataResponseMessage_StreamTaskIsNull";
        internal const string ODataResponseMessage_MessageStreamIsNull = "ODataResponseMessage_MessageStreamIsNull";
        internal const string AsyncBufferedStream_WriterDisposedWithoutFlush = "AsyncBufferedStream_WriterDisposedWithoutFlush";
        internal const string ODataWriter_RelativeUriUsedWithoutBaseUriSpecified = "ODataWriter_RelativeUriUsedWithoutBaseUriSpecified";
        internal const string ODataWriter_MultiValueElementsMustNotBeNull = "ODataWriter_MultiValueElementsMustNotBeNull";
        internal const string ODataWriter_NestedMultiValuesAreNotSupported = "ODataWriter_NestedMultiValuesAreNotSupported";
        internal const string ODataWriter_UnsupportedPrimitiveType = "ODataWriter_UnsupportedPrimitiveType";
        internal const string ODataWriter_EntriesMustHaveNonEmptyId = "ODataWriter_EntriesMustHaveNonEmptyId";
        internal const string ODataWriter_FeedsMustHaveNonEmptyId = "ODataWriter_FeedsMustHaveNonEmptyId";
        internal const string ODataWriter_PropertyMustNotBeNull = "ODataWriter_PropertyMustNotBeNull";
        internal const string ODataWriter_PropertiesMustHaveNonEmptyName = "ODataWriter_PropertiesMustHaveNonEmptyName";
        internal const string ODataWriter_TypeNameMustNotBeEmpty = "ODataWriter_TypeNameMustNotBeEmpty";
        internal const string ODataWriter_NamedStreamMustNotBeNull = "ODataWriter_NamedStreamMustNotBeNull";
        internal const string ODataWriter_NamedStreamMustHaveNonEmptyName = "ODataWriter_NamedStreamMustHaveNonEmptyName";
        internal const string ODataWriter_LinkMustSpecifyName = "ODataWriter_LinkMustSpecifyName";
        internal const string ODataWriter_LinkMustSpecifyUrl = "ODataWriter_LinkMustSpecifyUrl";
        internal const string ODataWriter_AssociationLinkMustNotBeNull = "ODataWriter_AssociationLinkMustNotBeNull";
        internal const string ODataWriter_AssociationLinkMustSpecifyName = "ODataWriter_AssociationLinkMustSpecifyName";
        internal const string ODataWriter_AssociationLinkMustSpecifyUrl = "ODataWriter_AssociationLinkMustSpecifyUrl";
        internal const string ODataWriter_DefaultStreamMustNotHaveName = "ODataWriter_DefaultStreamMustNotHaveName";
        internal const string ODataWriter_DefaultStreamMustHaveNonEmptyContentType = "ODataWriter_DefaultStreamMustHaveNonEmptyContentType";
        internal const string ODataWriter_DefaultStreamMustHaveReadLink = "ODataWriter_DefaultStreamMustHaveReadLink";
        internal const string ODataWriter_DefaultStreamMustHaveEditLinkToHaveETag = "ODataWriter_DefaultStreamMustHaveEditLinkToHaveETag";
        internal const string ODataWriter_CannotCreateWriterForFormat = "ODataWriter_CannotCreateWriterForFormat";
        internal const string ODataWriter_BaseUriMustBeNullOrAbsolute = "ODataWriter_BaseUriMustBeNullOrAbsolute";
        internal const string ODataWriter_MultiValuePropertiesMustNotHaveNullValue = "ODataWriter_MultiValuePropertiesMustNotHaveNullValue";
        internal const string ODataWriter_PropertyDoesNotExistOnType = "ODataWriter_PropertyDoesNotExistOnType";
        internal const string ODataWriter_IncompatibleTypeKind = "ODataWriter_IncompatibleTypeKind";
        internal const string ODataWriter_IncompatibleType = "ODataWriter_IncompatibleType";
        internal const string ODataWriterCore_FeedExpandedLinkWithEntryContent = "ODataWriterCore_FeedExpandedLinkWithEntryContent";
        internal const string ODataWriterCore_EntryExpandedLinkWithFeedContent = "ODataWriterCore_EntryExpandedLinkWithFeedContent";
        internal const string ODataWriterCore_InvalidStateTransition = "ODataWriterCore_InvalidStateTransition";
        internal const string ODataWriterCore_InvalidTransitionFromStart = "ODataWriterCore_InvalidTransitionFromStart";
        internal const string ODataWriterCore_InvalidTransitionFromEntry = "ODataWriterCore_InvalidTransitionFromEntry";
        internal const string ODataWriterCore_InvalidTransitionFromFeed = "ODataWriterCore_InvalidTransitionFromFeed";
        internal const string ODataWriterCore_InvalidTransitionFromExpandedLink = "ODataWriterCore_InvalidTransitionFromExpandedLink";
        internal const string ODataWriterCore_InvalidTransitionFromCompleted = "ODataWriterCore_InvalidTransitionFromCompleted";
        internal const string ODataWriterCore_InvalidTransitionFromODataExceptionThrown = "ODataWriterCore_InvalidTransitionFromODataExceptionThrown";
        internal const string ODataWriterCore_InvalidTransitionFromFatalExceptionThrown = "ODataWriterCore_InvalidTransitionFromFatalExceptionThrown";
        internal const string ODataWriterCore_InvalidTransitionFromError = "ODataWriterCore_InvalidTransitionFromError";
        internal const string ODataWriterCore_WriteEndCalledInInvalidState = "ODataWriterCore_WriteEndCalledInInvalidState";
        internal const string ODataWriterCore_ItemHasChangedBetweenStartAndEndWrite = "ODataWriterCore_ItemHasChangedBetweenStartAndEndWrite";
        internal const string ODataWriterCore_WriterDisposedWithoutAllWriteEnds = "ODataWriterCore_WriterDisposedWithoutAllWriteEnds";
        internal const string ODataWriterCore_OnlyTopLevelFeedsSupportInlineCount = "ODataWriterCore_OnlyTopLevelFeedsSupportInlineCount";
        internal const string ODataWriterCore_InlineCountInRequest = "ODataWriterCore_InlineCountInRequest";
        internal const string ODataWriterCore_NextPageLinkInRequest = "ODataWriterCore_NextPageLinkInRequest";
        internal const string ODataWriterCore_FlushAsyncCalledInFatalErrorState = "ODataWriterCore_FlushAsyncCalledInFatalErrorState";
        internal const string ODataWriterCore_MissingTypeNameWithMetadata = "ODataWriterCore_MissingTypeNameWithMetadata";
        internal const string ODataWriterCore_UnrecognizedTypeName = "ODataWriterCore_UnrecognizedTypeName";
        internal const string ODataWriterCore_IncorrectTypeKind = "ODataWriterCore_IncorrectTypeKind";
        internal const string ODataWriterCore_InvalidMultiValueTypeName = "ODataWriterCore_InvalidMultiValueTypeName";
        internal const string ODataWriterCore_CannotWriteTopLevelFeedWithEntryWriter = "ODataWriterCore_CannotWriteTopLevelFeedWithEntryWriter";
        internal const string ODataWriterCore_CannotWriteTopLevelEntryWithFeedWriter = "ODataWriterCore_CannotWriteTopLevelEntryWithFeedWriter";
        internal const string ODataWriterCore_SyncCallOnAsyncWriter = "ODataWriterCore_SyncCallOnAsyncWriter";
        internal const string ODataWriterCore_AsyncCallOnSyncWriter = "ODataWriterCore_AsyncCallOnSyncWriter";
        internal const string AtomValueUtils_CannotConvertValueToAtomPrimitive = "AtomValueUtils_CannotConvertValueToAtomPrimitive";
        internal const string ODataAtomWriter_LinkMetadataHrefMustBeEqualWithLinkUrl = "ODataAtomWriter_LinkMetadataHrefMustBeEqualWithLinkUrl";
        internal const string ODataAtomWriter_LinkMetadataRelationMustBeEqualWithComputedRelation = "ODataAtomWriter_LinkMetadataRelationMustBeEqualWithComputedRelation";
        internal const string ODataAtomWriter_LinkMetadataMediaTypeMustBeEqualWithComputedType = "ODataAtomWriter_LinkMetadataMediaTypeMustBeEqualWithComputedType";
        internal const string ODataAtomWriter_LinkMetadataTitleMustBeEqualWithLinkName = "ODataAtomWriter_LinkMetadataTitleMustBeEqualWithLinkName";
        internal const string ODataJsonWriter_UnsupportedValueType = "ODataJsonWriter_UnsupportedValueType";
        internal const string ODataException_GeneralError = "ODataException_GeneralError";
        internal const string ODataVersionChecker_InlineCountNotSupported = "ODataVersionChecker_InlineCountNotSupported";
        internal const string ODataVersionChecker_MultiValuePropertiesNotSupported = "ODataVersionChecker_MultiValuePropertiesNotSupported";
        internal const string ODataVersionChecker_ServerPagingNotSupported = "ODataVersionChecker_ServerPagingNotSupported";
        internal const string ODataVersionChecker_NamedStreamsNotSupported = "ODataVersionChecker_NamedStreamsNotSupported";
        internal const string ODataVersionChecker_EpmVersionNotSupported = "ODataVersionChecker_EpmVersionNotSupported";
        internal const string ODataVersionChecker_ProtocolVersion3IsNotSupported = "ODataVersionChecker_ProtocolVersion3IsNotSupported";
        internal const string ODataAtomWriterUtils_BaseUriRequiredForWritingServiceDocument = "ODataAtomWriterUtils_BaseUriRequiredForWritingServiceDocument";
        internal const string ODataAtomWriterMetadataUtils_AuthorMetadataMustNotContainNull = "ODataAtomWriterMetadataUtils_AuthorMetadataMustNotContainNull";
        internal const string ODataAtomWriterMetadataUtils_CategoryMetadataMustNotContainNull = "ODataAtomWriterMetadataUtils_CategoryMetadataMustNotContainNull";
        internal const string ODataAtomWriterMetadataUtils_ContributorMetadataMustNotContainNull = "ODataAtomWriterMetadataUtils_ContributorMetadataMustNotContainNull";
        internal const string ODataAtomWriterMetadataUtils_LinkMetadataMustNotContainNull = "ODataAtomWriterMetadataUtils_LinkMetadataMustNotContainNull";
        internal const string ODataAtomWriterMetadataUtils_LinkMustSpecifyHref = "ODataAtomWriterMetadataUtils_LinkMustSpecifyHref";
        internal const string ODataAtomWriterMetadataUtils_CategoryMustSpecifyTerm = "ODataAtomWriterMetadataUtils_CategoryMustSpecifyTerm";
        internal const string ODataAtomMetadataEpmMerge_TextKindConflict = "ODataAtomMetadataEpmMerge_TextKindConflict";
        internal const string ODataAtomMetadataEpmMerge_TextValueConflict = "ODataAtomMetadataEpmMerge_TextValueConflict";
        internal const string ODataVersionChecker_AssociationLinksNotSupported = "ODataVersionChecker_AssociationLinksNotSupported";
        internal const string ODataMessageWriter_WriterAlreadyUsed = "ODataMessageWriter_WriterAlreadyUsed";
        internal const string ODataMessageWriter_InvalidContentTypeForWritingProperty = "ODataMessageWriter_InvalidContentTypeForWritingProperty";
        internal const string ODataMessageWriter_InvalidContentTypeForWritingLink = "ODataMessageWriter_InvalidContentTypeForWritingLink";
        internal const string ODataMessageWriter_InvalidContentTypeForWritingLinks = "ODataMessageWriter_InvalidContentTypeForWritingLinks";
        internal const string ODataMessageWriter_InvalidContentTypeForWritingError = "ODataMessageWriter_InvalidContentTypeForWritingError";
        internal const string ODataMessageWriter_InvalidAcceptHeaderForWritingRawValue = "ODataMessageWriter_InvalidAcceptHeaderForWritingRawValue";
        internal const string ODataMessageWriter_InvalidContentTypeForWritingServiceDocument = "ODataMessageWriter_InvalidContentTypeForWritingServiceDocument";
        internal const string ODataMessageWriter_InvalidContentTypeForWritingRawValue = "ODataMessageWriter_InvalidContentTypeForWritingRawValue";
        internal const string ODataMessageWriter_NextPageLinkInRequest = "ODataMessageWriter_NextPageLinkInRequest";
        internal const string ODataMessageWriter_InlineCountInRequest = "ODataMessageWriter_InlineCountInRequest";
        internal const string ODataMessageWriter_ErrorPayloadInRequest = "ODataMessageWriter_ErrorPayloadInRequest";
        internal const string ODataMessageWriter_CollectionInRequest = "ODataMessageWriter_CollectionInRequest";
        internal const string ODataMessageWriter_ServiceDocumentInRequest = "ODataMessageWriter_ServiceDocumentInRequest";
        internal const string ODataMessageWriter_CannotWriteNullInRawFormat = "ODataMessageWriter_CannotWriteNullInRawFormat";
        internal const string ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind = "ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind";
        internal const string ODataMessageWriter_IncompatiblePayloadKinds = "ODataMessageWriter_IncompatiblePayloadKinds";
        internal const string ODataCollectionWriter_CannotCreateCollectionWriterForFormat = "ODataCollectionWriter_CannotCreateCollectionWriterForFormat";
        internal const string ODataCollectionWriter_MultiValuesNotSupportedInCollections = "ODataCollectionWriter_MultiValuesNotSupportedInCollections";
        internal const string ODataCollectionWriterCore_InvalidTransitionFromStart = "ODataCollectionWriterCore_InvalidTransitionFromStart";
        internal const string ODataCollectionWriterCore_InvalidTransitionFromCollection = "ODataCollectionWriterCore_InvalidTransitionFromCollection";
        internal const string ODataCollectionWriterCore_InvalidTransitionFromItem = "ODataCollectionWriterCore_InvalidTransitionFromItem";
        internal const string ODataCollectionWriterCore_WriteEndCalledInInvalidState = "ODataCollectionWriterCore_WriteEndCalledInInvalidState";
        internal const string ODataCollectionWriterCore_SyncCallOnAsyncWriter = "ODataCollectionWriterCore_SyncCallOnAsyncWriter";
        internal const string ODataCollectionWriterCore_AsyncCallOnSyncWriter = "ODataCollectionWriterCore_AsyncCallOnSyncWriter";
        internal const string ODataBatchWriter_FlushOrFlushAsyncCalledInFatalErrorState = "ODataBatchWriter_FlushOrFlushAsyncCalledInFatalErrorState";
        internal const string ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState = "ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState";
        internal const string ODataBatchWriter_WriterDisposedWithoutProperBatchEnd = "ODataBatchWriter_WriterDisposedWithoutProperBatchEnd";
        internal const string ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet = "ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet";
        internal const string ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet = "ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet";
        internal const string ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet = "ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet";
        internal const string ODataBatchWriter_InvalidTransitionFromStart = "ODataBatchWriter_InvalidTransitionFromStart";
        internal const string ODataBatchWriter_InvalidTransitionFromBatchStarted = "ODataBatchWriter_InvalidTransitionFromBatchStarted";
        internal const string ODataBatchWriter_InvalidTransitionFromChangeSetStarted = "ODataBatchWriter_InvalidTransitionFromChangeSetStarted";
        internal const string ODataBatchWriter_InvalidTransitionFromOperationCreated = "ODataBatchWriter_InvalidTransitionFromOperationCreated";
        internal const string ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested = "ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested";
        internal const string ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed = "ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed";
        internal const string ODataBatchWriter_InvalidTransitionFromChangeSetCompleted = "ODataBatchWriter_InvalidTransitionFromChangeSetCompleted";
        internal const string ODataBatchWriter_InvalidTransitionFromBatchCompleted = "ODataBatchWriter_InvalidTransitionFromBatchCompleted";
        internal const string ODataBatchWriter_InvalidTransitionFromFatalExceptionThrown = "ODataBatchWriter_InvalidTransitionFromFatalExceptionThrown";
        internal const string ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse = "ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse";
        internal const string ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest = "ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest";
        internal const string ODataBatchWriter_InvalidHttpMethodForQueryOperation = "ODataBatchWriter_InvalidHttpMethodForQueryOperation";
        internal const string ODataBatchWriter_InvalidHttpMethodForChangeSetRequest = "ODataBatchWriter_InvalidHttpMethodForChangeSetRequest";
        internal const string ODataBatchWriter_ContentIdNotSupportedForQueryOperations = "ODataBatchWriter_ContentIdNotSupportedForQueryOperations";
        internal const string ODataBatchWriter_MaxBatchSizeExceeded = "ODataBatchWriter_MaxBatchSizeExceeded";
        internal const string ODataBatchWriter_MaxChangeSetSizeExceeded = "ODataBatchWriter_MaxChangeSetSizeExceeded";
        internal const string ODataBatchWriter_SyncCallOnAsyncWriter = "ODataBatchWriter_SyncCallOnAsyncWriter";
        internal const string ODataBatchWriter_AsyncCallOnSyncWriter = "ODataBatchWriter_AsyncCallOnSyncWriter";
        internal const string ODataBatchWriterUtils_RelativeUriUsedWithoutBaseUriSpecified = "ODataBatchWriterUtils_RelativeUriUsedWithoutBaseUriSpecified";
        internal const string ODataBatchOperationMessage_VerifyNotCompleted = "ODataBatchOperationMessage_VerifyNotCompleted";
        internal const string ODataBatchOperationStream_Disposed = "ODataBatchOperationStream_Disposed";
        internal const string HttpUtils_MediaTypeUnspecified = "HttpUtils_MediaTypeUnspecified";
        internal const string HttpUtils_MediaTypeRequiresSlash = "HttpUtils_MediaTypeRequiresSlash";
        internal const string HttpUtils_MediaTypeRequiresSubType = "HttpUtils_MediaTypeRequiresSubType";
        internal const string HttpUtils_MediaTypeMissingParameterValue = "HttpUtils_MediaTypeMissingParameterValue";
        internal const string HttpUtils_MediaTypeMissingParameterName = "HttpUtils_MediaTypeMissingParameterName";
        internal const string HttpUtils_EscapeCharWithoutQuotes = "HttpUtils_EscapeCharWithoutQuotes";
        internal const string HttpUtils_EscapeCharAtEnd = "HttpUtils_EscapeCharAtEnd";
        internal const string HttpUtils_ClosingQuoteNotFound = "HttpUtils_ClosingQuoteNotFound";
        internal const string HttpUtils_ContentTypeMissing = "HttpUtils_ContentTypeMissing";
        internal const string HttpUtils_MediaTypeRequiresSemicolonBeforeParameter = "HttpUtils_MediaTypeRequiresSemicolonBeforeParameter";
        internal const string HttpUtils_InvalidQualityValueStartChar = "HttpUtils_InvalidQualityValueStartChar";
        internal const string HttpUtils_InvalidQualityValue = "HttpUtils_InvalidQualityValue";
        internal const string HttpUtils_CannotConvertCharToInt = "HttpUtils_CannotConvertCharToInt";
        internal const string HttpUtils_MissingSeparatorBetweenCharsets = "HttpUtils_MissingSeparatorBetweenCharsets";
        internal const string HttpUtils_InvalidSeparatorBetweenCharsets = "HttpUtils_InvalidSeparatorBetweenCharsets";
        internal const string HttpUtils_InvalidCharsetName = "HttpUtils_InvalidCharsetName";
        internal const string HttpUtils_UnexpectedEndOfQValue = "HttpUtils_UnexpectedEndOfQValue";
        internal const string HttpUtils_ExpectedLiteralNotFoundInString = "HttpUtils_ExpectedLiteralNotFoundInString";
        internal const string MediaType_EncodingNotSupported = "MediaType_EncodingNotSupported";
        internal const string ResourceProperty_Sealed = "ResourceProperty_Sealed";
        internal const string ResourceProperty_MimeTypeAttributeEmpty = "ResourceProperty_MimeTypeAttributeEmpty";
        internal const string ResourceProperty_MimeTypeAttributeOnNonPrimitive = "ResourceProperty_MimeTypeAttributeOnNonPrimitive";
        internal const string ResourceProperty_MimeTypeNotValid = "ResourceProperty_MimeTypeNotValid";
        internal const string ResourceProperty_PropertyKindAndResourceTypeKindMismatch = "ResourceProperty_PropertyKindAndResourceTypeKindMismatch";
        internal const string ResourceProperty_KeyPropertiesCannotBeNullable = "ResourceProperty_KeyPropertiesCannotBeNullable";
        internal const string ResourceProperty_NamedStreamCannotReflect = "ResourceProperty_NamedStreamCannotReflect";
        internal const string ResourceProperty_NamedStreamKindMustBeUsedAlone = "ResourceProperty_NamedStreamKindMustBeUsedAlone";
        internal const string ResourceType_Sealed = "ResourceType_Sealed";
        internal const string ResourceType_InvalidValueForResourceTypeKind = "ResourceType_InvalidValueForResourceTypeKind";
        internal const string ResourceType_InvalidResourceTypeKindInheritance = "ResourceType_InvalidResourceTypeKindInheritance";
        internal const string ResourceType_TypeCannotBeValueType = "ResourceType_TypeCannotBeValueType";
        internal const string ResourceType_HasStreamAttributeOnlyAppliesToEntityType = "ResourceType_HasStreamAttributeOnlyAppliesToEntityType";
        internal const string ResourceType_ComplexTypeCannotBeOpen = "ResourceType_ComplexTypeCannotBeOpen";
        internal const string ResourceType_MultiValueItemCanBeOnlyPrimitiveOrComplex = "ResourceType_MultiValueItemCanBeOnlyPrimitiveOrComplex";
        internal const string ResourceType_NamedStreamsOnlyApplyToEntityType = "ResourceType_NamedStreamsOnlyApplyToEntityType";
        internal const string ResourceType_PropertyWithSameNameAlreadyExists = "ResourceType_PropertyWithSameNameAlreadyExists";
        internal const string ResourceType_MissingKeyPropertiesForEntity = "ResourceType_MissingKeyPropertiesForEntity";
        internal const string ResourceType_NoKeysInDerivedTypes = "ResourceType_NoKeysInDerivedTypes";
        internal const string ResourceType_KeyPropertiesOnlyOnEntityTypes = "ResourceType_KeyPropertiesOnlyOnEntityTypes";
        internal const string ResourceType_ETagPropertiesOnlyOnEntityTypes = "ResourceType_ETagPropertiesOnlyOnEntityTypes";
        internal const string ResourceType_EpmOnlyAllowedOnEntityTypes = "ResourceType_EpmOnlyAllowedOnEntityTypes";
        internal const string ResourceSet_ResourceSetMustBeAssociatedWithEntityType = "ResourceSet_ResourceSetMustBeAssociatedWithEntityType";
        internal const string ResourceSet_Sealed = "ResourceSet_Sealed";
        internal const string ResourceAssociationSet_ResourcePropertyCannotBeBothNull = "ResourceAssociationSet_ResourcePropertyCannotBeBothNull";
        internal const string ResourceAssociationSet_SelfReferencingAssociationCannotBeBiDirectional = "ResourceAssociationSet_SelfReferencingAssociationCannotBeBiDirectional";
        internal const string ResourceAssociationSetEnd_ResourcePropertyMustBeNavigationPropertyOnResourceType = "ResourceAssociationSetEnd_ResourcePropertyMustBeNavigationPropertyOnResourceType";
        internal const string ResourceAssociationSetEnd_ResourceTypeMustBeAssignableToResourceSet = "ResourceAssociationSetEnd_ResourceTypeMustBeAssignableToResourceSet";
        internal const string ServiceOperationParameter_TypeNotSupported = "ServiceOperationParameter_TypeNotSupported";
        internal const string ServiceOperation_Sealed = "ServiceOperation_Sealed";
        internal const string ServiceOperation_ResultTypeAndKindMustMatch = "ServiceOperation_ResultTypeAndKindMustMatch";
        internal const string ServiceOperation_ResultSetMustBeNull = "ServiceOperation_ResultSetMustBeNull";
        internal const string ServiceOperation_ResultTypeAndResultSetMustMatch = "ServiceOperation_ResultTypeAndResultSetMustMatch";
        internal const string ServiceOperation_InvalidResultType = "ServiceOperation_InvalidResultType";
        internal const string ServiceOperation_NotSupportedProtocolMethod = "ServiceOperation_NotSupportedProtocolMethod";
        internal const string ServiceOperation_DuplicateParameterName = "ServiceOperation_DuplicateParameterName";
        internal const string ServiceOperation_MimeTypeCannotBeEmpty = "ServiceOperation_MimeTypeCannotBeEmpty";
        internal const string ServiceOperation_MimeTypeNotValid = "ServiceOperation_MimeTypeNotValid";
        internal const string DataServiceMetadataProviderWrapper_ResourceTypeNotReadonly = "DataServiceMetadataProviderWrapper_ResourceTypeNotReadonly";
        internal const string DataServiceMetadataProviderWrapper_ResourceSetNotReadonly = "DataServiceMetadataProviderWrapper_ResourceSetNotReadonly";
        internal const string DataServiceMetadataProviderWrapper_ServiceOperationNotReadonly = "DataServiceMetadataProviderWrapper_ServiceOperationNotReadonly";
        internal const string DataServiceMetadataProviderWrapper_MultipleEntitySetsWithSameName = "DataServiceMetadataProviderWrapper_MultipleEntitySetsWithSameName";
        internal const string DataServiceMetadataProviderWrapper_MultipleServiceOperationsWithSameName = "DataServiceMetadataProviderWrapper_MultipleServiceOperationsWithSameName";
        internal const string DataServiceMetadataProviderWrapper_MultipleResourceTypesWithSameName = "DataServiceMetadataProviderWrapper_MultipleResourceTypesWithSameName";
        internal const string EntityPropertyMapping_EpmAttribute = "EntityPropertyMapping_EpmAttribute";
        internal const string EntityPropertyMapping_InvalidTargetPath = "EntityPropertyMapping_InvalidTargetPath";
        internal const string EntityPropertyMapping_TargetNamespaceUriNotValid = "EntityPropertyMapping_TargetNamespaceUriNotValid";
        internal const string EpmSourceTree_InvalidSourcePath = "EpmSourceTree_InvalidSourcePath";
        internal const string EpmSourceTree_NestedMultiValue = "EpmSourceTree_NestedMultiValue";
        internal const string EpmSourceTree_MultiValueNotAllowedInCustomMapping = "EpmSourceTree_MultiValueNotAllowedInCustomMapping";
        internal const string EpmSourceTree_PropertiesFromSameMultiValueMappedToDifferentTopLevelElements = "EpmSourceTree_PropertiesFromSameMultiValueMappedToDifferentTopLevelElements";
        internal const string EpmSourceTree_PropertiesFromSameMultiValueMappedWithDifferentKeepInContent = "EpmSourceTree_PropertiesFromSameMultiValueMappedWithDifferentKeepInContent";
        internal const string EpmSourceTree_EndsWithNonPrimitiveType = "EpmSourceTree_EndsWithNonPrimitiveType";
        internal const string EpmSourceTree_TraversalOfNonComplexType = "EpmSourceTree_TraversalOfNonComplexType";
        internal const string EpmSourceTree_DuplicateEpmAttrsWithSameSourceName = "EpmSourceTree_DuplicateEpmAttrsWithSameSourceName";
        internal const string EpmSourceTree_NotAllMultiValueItemPropertiesMapped = "EpmSourceTree_NotAllMultiValueItemPropertiesMapped";
        internal const string EpmSourceTree_MultiValueOfPrimitiveMappedToLinkWithoutCriteria = "EpmSourceTree_MultiValueOfPrimitiveMappedToLinkWithoutCriteria";
        internal const string EpmSourceTree_MultiValueOfComplexTypesDifferentConditionalMapping = "EpmSourceTree_MultiValueOfComplexTypesDifferentConditionalMapping";
        internal const string EpmSourceTree_ConditionalMappingInvalidLinkRelCriteriaValue = "EpmSourceTree_ConditionalMappingInvalidLinkRelCriteriaValue";
        internal const string EpmSourceTree_ConditionalMappingInvalidCategorySchemeCriteriaValue = "EpmSourceTree_ConditionalMappingInvalidCategorySchemeCriteriaValue";
        internal const string EpmSourceTree_MissingPropertyOnType = "EpmSourceTree_MissingPropertyOnType";
        internal const string EpmSourceTree_MissingPropertyOnInstance = "EpmSourceTree_MissingPropertyOnInstance";
        internal const string EpmSourceTree_NonStringPropertyMappedToConditionAttribute = "EpmSourceTree_NonStringPropertyMappedToConditionAttribute";
        internal const string EpmSourceTree_NamedStreamCannotBeMapped = "EpmSourceTree_NamedStreamCannotBeMapped";
        internal const string EpmTargetTree_InvalidTargetPath = "EpmTargetTree_InvalidTargetPath";
        internal const string EpmTargetTree_AttributeInMiddle = "EpmTargetTree_AttributeInMiddle";
        internal const string EpmTargetTree_MultiValueAndNormalPropertyMappedToTheSameConditionalTopLevelElement = "EpmTargetTree_MultiValueAndNormalPropertyMappedToTheSameConditionalTopLevelElement";
        internal const string EpmTargetTree_MultiValueAndNormalPropertyMappedToTheSameTopLevelElement = "EpmTargetTree_MultiValueAndNormalPropertyMappedToTheSameTopLevelElement";
        internal const string EpmTargetTree_MultiValueMappedToNonRepeatableAtomElement = "EpmTargetTree_MultiValueMappedToNonRepeatableAtomElement";
        internal const string EpmTargetTree_TwoMultiValuePropertiesMappedToTheSameConditionalTopLevelElement = "EpmTargetTree_TwoMultiValuePropertiesMappedToTheSameConditionalTopLevelElement";
        internal const string EpmTargetTree_TwoMultiValuePropertiesMappedToTheSameTopLevelElement = "EpmTargetTree_TwoMultiValuePropertiesMappedToTheSameTopLevelElement";
        internal const string EpmTargetTree_DuplicateEpmAttrsWithSameTargetName = "EpmTargetTree_DuplicateEpmAttrsWithSameTargetName";
        internal const string EpmTargetTree_ConditionalMappingCategoryTermIsRequired = "EpmTargetTree_ConditionalMappingCategoryTermIsRequired";
        internal const string EpmTargetTree_ConditionalMappingLinkHrefIsRequired = "EpmTargetTree_ConditionalMappingLinkHrefIsRequired";
        internal const string EpmTargetTree_ConditionalMappingRelIsRequiredForNonConditional = "EpmTargetTree_ConditionalMappingRelIsRequiredForNonConditional";
        internal const string EpmTargetTree_ConditionalMappingToCriteriaAttribute = "EpmTargetTree_ConditionalMappingToCriteriaAttribute";
        internal const string EpmTargetTree_ConditionalMappingToNonConditionalSyndicationItem = "EpmTargetTree_ConditionalMappingToNonConditionalSyndicationItem";
        internal const string EpmSyndicationWriter_DateTimePropertyHasNullValue = "EpmSyndicationWriter_DateTimePropertyHasNullValue";
        internal const string EpmSyndicationWriter_DateTimePropertyCanNotBeConverted = "EpmSyndicationWriter_DateTimePropertyCanNotBeConverted";
        internal const string ODataUtils_NonPrimitiveTypeForPrimitiveValue = "ODataUtils_NonPrimitiveTypeForPrimitiveValue";
        internal const string ODataUtils_IncompatiblePrimitiveItemType = "ODataUtils_IncompatiblePrimitiveItemType";
        internal const string ODataUtils_ResourceCollectionMustHaveName = "ODataUtils_ResourceCollectionMustHaveName";
        internal const string ODataUtils_ResourceCollectionMustHaveUniqueName = "ODataUtils_ResourceCollectionMustHaveUniqueName";
        internal const string ODataUtils_WorkspaceCollectionsMustNotContainNullItem = "ODataUtils_WorkspaceCollectionsMustNotContainNullItem";
        internal const string ODataUtils_MissingResourceCollectionForEntitySet = "ODataUtils_MissingResourceCollectionForEntitySet";
        internal const string ODataUtils_CannotConvertValueToRawPrimitive = "ODataUtils_CannotConvertValueToRawPrimitive";
        internal const string ODataUtils_DidNotFindMatchingMediaType = "ODataUtils_DidNotFindMatchingMediaType";
        internal const string ODataUtils_DidNotFindDefaultMediaType = "ODataUtils_DidNotFindDefaultMediaType";
        internal const string UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri = "UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri";
        internal const string UriQueryPathParser_SyntaxError = "UriQueryPathParser_SyntaxError";
        internal const string UriQueryPathParser_TooManySegments = "UriQueryPathParser_TooManySegments";
        internal const string UriQueryPathParser_InvalidKeyValueLiteral = "UriQueryPathParser_InvalidKeyValueLiteral";
        internal const string ExpressionLexer_UnterminatedStringLiteral = "ExpressionLexer_UnterminatedStringLiteral";
        internal const string ExpressionLexer_InvalidCharacter = "ExpressionLexer_InvalidCharacter";
        internal const string ExpressionLexer_SyntaxError = "ExpressionLexer_SyntaxError";
        internal const string ExpressionLexer_UnterminatedLiteral = "ExpressionLexer_UnterminatedLiteral";
        internal const string ExpressionLexer_DigitExpected = "ExpressionLexer_DigitExpected";
        internal const string ExpressionToken_IdentifierExpected = "ExpressionToken_IdentifierExpected";
        internal const string ExceptionUtils_CheckIntegerNotNegative = "ExceptionUtils_CheckIntegerNotNegative";
        internal const string ExceptionUtils_ArgumentStringNullOrEmpty = "ExceptionUtils_ArgumentStringNullOrEmpty";
        internal const string UriQueryExpressionParser_TooDeep = "UriQueryExpressionParser_TooDeep";
        internal const string UriQueryExpressionParser_UnrecognizedLiteral = "UriQueryExpressionParser_UnrecognizedLiteral";
        internal const string UriQueryExpressionParser_ExpressionExpected = "UriQueryExpressionParser_ExpressionExpected";
        internal const string UriQueryExpressionParser_OpenParenExpected = "UriQueryExpressionParser_OpenParenExpected";
        internal const string UriQueryExpressionParser_CloseParenOrCommaExpected = "UriQueryExpressionParser_CloseParenOrCommaExpected";
        internal const string UriQueryExpressionParser_CloseParenOrOperatorExpected = "UriQueryExpressionParser_CloseParenOrOperatorExpected";
        internal const string QueryDescriptorQueryToken_UriMustBeAbsolute = "QueryDescriptorQueryToken_UriMustBeAbsolute";
        internal const string QueryDescriptorQueryToken_MaxDepthInvalid = "QueryDescriptorQueryToken_MaxDepthInvalid";
        internal const string QueryDescriptorQueryToken_InvalidSkipQueryOptionValue = "QueryDescriptorQueryToken_InvalidSkipQueryOptionValue";
        internal const string QueryDescriptorQueryToken_InvalidTopQueryOptionValue = "QueryDescriptorQueryToken_InvalidTopQueryOptionValue";
        internal const string QueryOptionUtils_QueryParameterMustBeSpecifiedOnce = "QueryOptionUtils_QueryParameterMustBeSpecifiedOnce";
        internal const string MetadataBinder_UnsupportedQueryTokenKind = "MetadataBinder_UnsupportedQueryTokenKind";
        internal const string MetadataBinder_UnsupportedExtensionToken = "MetadataBinder_UnsupportedExtensionToken";
        internal const string MetadataBinder_RootSegmentResourceNotFound = "MetadataBinder_RootSegmentResourceNotFound";
        internal const string MetadataBinder_KeyValueApplicableOnlyToEntityType = "MetadataBinder_KeyValueApplicableOnlyToEntityType";
        internal const string MetadataBinder_PropertyNotDeclared = "MetadataBinder_PropertyNotDeclared";
        internal const string MetadataBinder_PropertyNotKeyInKeyValue = "MetadataBinder_PropertyNotKeyInKeyValue";
        internal const string MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties = "MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties";
        internal const string MetadataBinder_DuplicitKeyPropertyInKeyValues = "MetadataBinder_DuplicitKeyPropertyInKeyValues";
        internal const string MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues = "MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues";
        internal const string MetadataBinder_CannotConvertToType = "MetadataBinder_CannotConvertToType";
        internal const string MetadataBinder_NonQueryableServiceOperationWithKeyLookup = "MetadataBinder_NonQueryableServiceOperationWithKeyLookup";
        internal const string MetadataBinder_QueryServiceOperationOfNonEntityType = "MetadataBinder_QueryServiceOperationOfNonEntityType";
        internal const string MetadataBinder_ServiceOperationParameterMissing = "MetadataBinder_ServiceOperationParameterMissing";
        internal const string MetadataBinder_ServiceOperationParameterInvalidType = "MetadataBinder_ServiceOperationParameterInvalidType";
        internal const string MetadataBinder_FilterNotApplicable = "MetadataBinder_FilterNotApplicable";
        internal const string MetadataBinder_FilterExpressionNotSingleValue = "MetadataBinder_FilterExpressionNotSingleValue";
        internal const string MetadataBinder_OrderByNotApplicable = "MetadataBinder_OrderByNotApplicable";
        internal const string MetadataBinder_OrderByExpressionNotSingleValue = "MetadataBinder_OrderByExpressionNotSingleValue";
        internal const string MetadataBinder_SkipNotApplicable = "MetadataBinder_SkipNotApplicable";
        internal const string MetadataBinder_TopNotApplicable = "MetadataBinder_TopNotApplicable";
        internal const string MetadataBinder_PropertyAccessWithoutParentParameter = "MetadataBinder_PropertyAccessWithoutParentParameter";
        internal const string MetadataBinder_MultiValuePropertyNotSupportedInExpression = "MetadataBinder_MultiValuePropertyNotSupportedInExpression";
        internal const string MetadataBinder_BinaryOperatorOperandNotSingleValue = "MetadataBinder_BinaryOperatorOperandNotSingleValue";
        internal const string MetadataBinder_UnaryOperatorOperandNotSingleValue = "MetadataBinder_UnaryOperatorOperandNotSingleValue";
        internal const string MetadataBinder_PropertyAccessSourceNotSingleValue = "MetadataBinder_PropertyAccessSourceNotSingleValue";
        internal const string MetadataBinder_IncompatibleOperandsError = "MetadataBinder_IncompatibleOperandsError";
        internal const string MetadataBinder_IncompatibleOperandError = "MetadataBinder_IncompatibleOperandError";
        internal const string MetadataBinder_UnknownFunction = "MetadataBinder_UnknownFunction";
        internal const string MetadataBinder_FunctionArgumentNotSingleValue = "MetadataBinder_FunctionArgumentNotSingleValue";
        internal const string MetadataBinder_NoApplicableFunctionFound = "MetadataBinder_NoApplicableFunctionFound";
        internal const string MetadataBinder_UnsupportedSystemQueryOption = "MetadataBinder_UnsupportedSystemQueryOption";
        internal const string MetadataBinder_BoundNodeCannotBeNull = "MetadataBinder_BoundNodeCannotBeNull";
        internal const string MetadataBinder_TopRequiresNonNegativeInteger = "MetadataBinder_TopRequiresNonNegativeInteger";
        internal const string MetadataBinder_SkipRequiresNonNegativeInteger = "MetadataBinder_SkipRequiresNonNegativeInteger";
        internal const string BinaryOperatorQueryNode_InvalidOperandType = "BinaryOperatorQueryNode_InvalidOperandType";
        internal const string BinaryOperatorQueryNode_OperandsMustHaveSameTypes = "BinaryOperatorQueryNode_OperandsMustHaveSameTypes";
        internal const string QueryExpressionTranslator_UnsupportedQueryNodeKind = "QueryExpressionTranslator_UnsupportedQueryNodeKind";
        internal const string QueryExpressionTranslator_UnsupportedExtensionNode = "QueryExpressionTranslator_UnsupportedExtensionNode";
        internal const string QueryExpressionTranslator_NodeTranslatedToNull = "QueryExpressionTranslator_NodeTranslatedToNull";
        internal const string QueryExpressionTranslator_NodeTranslatedToWrongType = "QueryExpressionTranslator_NodeTranslatedToWrongType";
        internal const string QueryExpressionTranslator_CollectionQueryNodeWithoutItemType = "QueryExpressionTranslator_CollectionQueryNodeWithoutItemType";
        internal const string QueryExpressionTranslator_SingleValueQueryNodeWithoutResourceType = "QueryExpressionTranslator_SingleValueQueryNodeWithoutResourceType";
        internal const string QueryExpressionTranslator_ConstantNonPrimitive = "QueryExpressionTranslator_ConstantNonPrimitive";
        internal const string QueryExpressionTranslator_KeyLookupOnlyOnEntities = "QueryExpressionTranslator_KeyLookupOnlyOnEntities";
        internal const string QueryExpressionTranslator_KeyLookupOnlyOnQueryable = "QueryExpressionTranslator_KeyLookupOnlyOnQueryable";
        internal const string QueryExpressionTranslator_KeyLookupWithoutKeyProperty = "QueryExpressionTranslator_KeyLookupWithoutKeyProperty";
        internal const string QueryExpressionTranslator_KeyLookupWithNoKeyValues = "QueryExpressionTranslator_KeyLookupWithNoKeyValues";
        internal const string QueryExpressionTranslator_KeyPropertyValueWithoutProperty = "QueryExpressionTranslator_KeyPropertyValueWithoutProperty";
        internal const string QueryExpressionTranslator_KeyPropertyValueWithWrongValue = "QueryExpressionTranslator_KeyPropertyValueWithWrongValue";
        internal const string QueryExpressionTranslator_FilterCollectionOfWrongType = "QueryExpressionTranslator_FilterCollectionOfWrongType";
        internal const string QueryExpressionTranslator_FilterExpressionOfWrongType = "QueryExpressionTranslator_FilterExpressionOfWrongType";
        internal const string QueryExpressionTranslator_UnaryNotOperandNotBoolean = "QueryExpressionTranslator_UnaryNotOperandNotBoolean";
        internal const string QueryExpressionTranslator_PropertyAccessSourceWrongType = "QueryExpressionTranslator_PropertyAccessSourceWrongType";
        internal const string QueryExpressionTranslator_ParameterNotDefinedInScope = "QueryExpressionTranslator_ParameterNotDefinedInScope";
        internal const string QueryExpressionTranslator_OrderByCollectionOfWrongType = "QueryExpressionTranslator_OrderByCollectionOfWrongType";
        internal const string QueryExpressionTranslator_UnknownFunction = "QueryExpressionTranslator_UnknownFunction";
        internal const string QueryExpressionTranslator_FunctionArgumentNotSingleValue = "QueryExpressionTranslator_FunctionArgumentNotSingleValue";
        internal const string QueryExpressionTranslator_NoApplicableFunctionFound = "QueryExpressionTranslator_NoApplicableFunctionFound";
        internal const string PropertyInfoResourceTypeAnnotation_CannotFindProperty = "PropertyInfoResourceTypeAnnotation_CannotFindProperty";

        static TextRes loader = null;
        ResourceManager resources;

        internal TextRes() {
            resources = new System.Resources.ResourceManager("System.Data.OData", this.GetType().Assembly);
        }
        
        private static TextRes GetLoader() {
            if (loader == null) {
                TextRes sr = new TextRes();
                Interlocked.CompareExchange(ref loader, sr, null);
            }
            return loader;
        }

        private static CultureInfo Culture {
            get { return null/*use ResourceManager default, CultureInfo.CurrentUICulture*/; }
        }
        
        public static ResourceManager Resources {
            get {
                return GetLoader().resources;
            }
        }
        
        public static string GetString(string name, params object[] args) {
            TextRes sys = GetLoader();
            if (sys == null)
                return null;
            string res = sys.resources.GetString(name, TextRes.Culture);

            if (args != null && args.Length > 0) {
                for (int i = 0; i < args.Length; i ++) {
                    String value = args[i] as String;
                    if (value != null && value.Length > 1024) {
                        args[i] = value.Substring(0, 1024 - 3) + "...";
                    }
                }
                return String.Format(CultureInfo.CurrentCulture, res, args);
            }
            else {
                return res;
            }
        }

        public static string GetString(string name) {
            TextRes sys = GetLoader();
            if (sys == null)
                return null;
            return sys.resources.GetString(name, TextRes.Culture);
        }
        
        public static string GetString(string name, out bool usedFallback) {
            // always false for this version of gensr
            usedFallback = false;
            return GetString(name);
        }

        public static object GetObject(string name) {
            TextRes sys = GetLoader();
            if (sys == null)
                return null;
            return sys.resources.GetObject(name, TextRes.Culture);
        }
    }
}
